home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4682 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.internetMCI.com!news-admin
  2. From: john b <jointprd@crl.com>
  3. Newsgroups: comp.lang.c,comp.unix.questions
  4. Subject: Help - Fork, exec
  5. Date: Tue, 06 Feb 1996 09:43:22 -0800
  6. Organization: G&R
  7. Message-ID: <3117933A.4E44@crl.com>
  8. NNTP-Posting-Host: 166.42.154.21
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b6b (Win16; I)
  13.  
  14. Ok - first things first I'm a DBA by trade and a C coder by necessity.  
  15. My C skills are OK at best, so bear with me if I ask "newbie-like" 
  16. questions.
  17.  
  18. Here's the issue - I have some code (specifically Open Server for Sybase) 
  19. that basically acts as a forwarding mechanism for Powerbuilder.  In other 
  20. words, Powerbuilder calls my SQL Server, the SQL Server calls the Open 
  21. Server, and ultimately the Open Server calls a UNIX parameterized (sp?) 
  22. script. (This is the architecture and will not change.) All works great 
  23. for a single user, but if I throw in a second user things gets screwed 
  24. up.  Basically, if the first user has not finished his "task" the second 
  25. one clobbers him.  My real world example consists of two users executing 
  26. an FTP.  One is not finished, the other cranks up and wham - the first is 
  27. killed.
  28.  
  29. So... here's the $100,000 question.  How can I make my code reentrant?  
  30. I'm toying with the idea of using fork and exec, but I've no clue how to 
  31. really use them.  Does anyone have a working example of how this works?  
  32. I've posted my original question in the comp.databases.sybase group, but 
  33. most of the folks are more of a SQL type.  If you want to see an snippet 
  34. of the code the post is under Open Server - Help Mutex by john b (in 
  35. comp.databases.sybase).  If you want me to post the question 
  36. here let me know too.  Basically I'm executing a system() call.
  37.  
  38. If I've placed the question in the wrong forum, my apologies.
  39.  
  40. Any help would be appreciated.
  41.  
  42. JB
  43.